Quantization is widely used in video coding or video compression. Quantization is a non-linear process that allows reducing the amount of bits needed for encoding a specific information. In general, quantization is a lossy process. Many methods exist for reducing quantization errors in a quantized signal.
For video compression, quantization errors may have many adverse effects on the perception of the underlying video. Some of the effects may be immediately visible to a user, while others may not be immediately visible but still important to the perceived quality of the video.
For block-based video compression (those used in video compression standards, such as MPEG-2, MPEG-4, H.264, or H.262), the most visible quantization effects may be banding and block artifacts, especially at low bitrate video compression. The block artifacts may be directly caused by block-based video compression schemes where pixel blocks are used to encode video. If the quantization is too strong (e.g., when the very low bitrates force the encoder to compress the video too deep), only a uniform color-flat block may be locally visible and thus lose all the details from the input picture frame.
Banding artifacts may be similar to block artifacts, but banding may be visible at all bitrates—including even high bitrates. Banding may be specially visible in areas having smooth gradient in color, e.g., a clear sky in a movie, or landscapes in a computer-generated movie graphics, e.g., in a cartoon movie.
Quantization errors may be introduced at a number of points during a video encoding process. Referring to FIG. 1, a source video may include a plurality of picture frames 102 digitally recorded or digitized from analog source of a non-compressed format having high precision and high bits per channel, e.g., 10 or 12 bits per channel (luma or chroma) with a high density chroma sampling factor, e.g., 4:4:4 in a Society of Motion Picture and Engineers (or SMPTE) specification. These high-quality video formats may preserve very fine details of the source video or picture frames as digital or digitized analog contents.
For consumer-quality video encoding and for implementation purpose, such as limitations on speed and storage, a majority of encoders may use a compression format with fewer number of bits per channel and/or a less wide chroma sub-sampling 106, e.g., 8 bits per channel with a 4:2:2 sampling factor or 8 bits per channel with a 4:2:0 sampling factor. The sub-sampled chroma format may be a compromise between quality and data rate.
The reduced number of bits may introduce quantization errors 104 directly on the non-compressed source, at the input of the encoding chain. Under certain situations, the provider of the source video may take appropriate measures to cover quantization and/or banding artifacts on the source video or picture frames. However, in other situations, the provider may not.
When only the low bits per channel version of a video is available rather than the high quality source video, a processor may perform a “blind” search for possible locations of banding or blocking artifacts. In encoding phase, the video encoder 108 may need to match the final coding bit rate to maximize video quality. The matching may be achieved by using rate control 110 at the encoder to drive the quantization 112 of the encoder. The encoded video may be transmitted over a communication channel or stored on a storage medium, e.g., a DVD, as encoded bitstreams for a decoder. Since low quality encoding may produce severe blocking artifacts, loop de-blocking filters may be used, e.g., in a H.264 decoder 116, to reduce these artifacts in the output picture frames 120.
The banding artifacts, even in high quality encoding schemes, may still be clearly visible to a user. This is especially true in coding movie scenes of large areas with uniform slow slope gradients of color, e.g., blue sky or fading in movie titles. This banding effect may be due to limitations in the block-based coding models in existing standards such as MPEG-2 or H.264. Having a color gradient whose slope is finer than the minimum quantization step allowed may most likely to cause visible artifacts on the final picture frames.
Dithering technique may be used to mask the banding artifacts that may be caused by quantization. “Dithering” is commonly understood as an intentional application of noise to video or audio, used to randomize quantization errors, to prevent large-scale patterns. Further, dithering is commonly applied globally to all pixels within a video frame before quantization or re-quantization process in order to prevent non-linear distortion. Additionally, the amount of noise added in dithering may depend on many factors. For example, the lesser the bit depth at each pixel, the greater the dither may need to be. A global dithering, e.g., adding the same amount of noise to each pixel based on a global measurement of quantization errors in a video frame may add noise not only to parts with banding artifacts, but also to parts that may not need to be dithered or may need to be dithered with different amounts of noise.
Therefore, there is a need for a dynamic blind analysis method and system that estimate the locations and amount of dithering for adaptively reducing banding effects caused by quantization.